package inputstream;

import java.io.IOException;
import java.io.InputStream;

public class StringInputStream extends InputStream{

	protected String input;
	protected int i;
	
	public StringInputStream(String _string){
		super();
		this.input=_string;
		this.i=0;
	}
	
	@Override
	public int read() throws IOException {
		int result;
		try{
			result=this.input.charAt(i++);
		} catch (Exception error){
			throw new IOException();
		}
		return result;
		
	}

}
